package com.tiro.springboot.sample.config;

import com.googlecode.jsonrpc4j.MultipleInvocationListener;
import com.googlecode.jsonrpc4j.spring.AutoJsonRpcServiceImplExporter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author long.qul
 * @date 24/01/2018
 */
@Configuration
public class JsonRpcConfig {

   @Bean
    public AutoJsonRpcServiceImplExporter autoJsonRpcServiceImplExporter() {
        AutoJsonRpcServiceImplExporter exporter = new AutoJsonRpcServiceImplExporter();
        exporter.setRegisterTraceInterceptor(true);
        MultipleInvocationListener invocationListener = new MultipleInvocationListener();
        exporter.setInvocationListener(invocationListener);
        // TODO error resolver
        return exporter;
    }

}
